package com.mj.guoqi.util;

import com.mj.guoqi.config.Constants;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * SQLite数据库工具类
 * @author zhaominglei
 * @date 2014-12-10
 * 
 */
public class DBHelper extends SQLiteOpenHelper {
	private static DBHelper instance;
	
	private DBHelper(Context context) {
		super(context, Constants.DB_NAME, null, Constants.DB_VERSION);
	}
	public static DBHelper getInstance(Context context) {
		if (instance == null) {
			instance = new DBHelper(context);
		}
		return instance;
	}
	
	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("create table if not exists guoqi(guoqiId integer primary key autoincrement,name varchar(255),logo varchar(255),introduction text)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	}
}
